﻿@model CommentViewModel

<div class="editComment">
@using (this.Html.BeginForm("SaveComment", "Comments"))
{
	<input type="hidden" name="id" value="@this.Model.Id" />
	<input type="hidden" name="entryId" value="@this.Model.EntryId" />
	<div class="editCommentHeader">
		<span>@Resources.Author:</span><input type="text" name="author" maxlength="200" value="@this.Model.Author" class="@(this.Model.IsAuthorValid ? "" : "errorInput")" />
	</div>
	<div class="editCommentContent">
		<span>@Resources.Content:</span><textarea cols="1" name="content" rows="3" class="@(this.Model.IsContentValid ? "" : "errorInput")">@this.Model.Content</textarea>
	</div>
	if (this.Model.DisplayMode == CommentDisplayMode.Add)
	{
		@this.Html.RenderCaptcha(this.Model.IsCaptchaValid);
		<text><button class="linkButton addComment" title="@Resources.SaveComment">@Resources.Save</button></text>
	}
	else
	{ 
		<text><button class="linkButton" title="@Resources.SaveComment">@Resources.Save</button></text>
	}
}

@if (this.Model.DisplayMode == CommentDisplayMode.Edit)
{
	using (this.Html.BeginForm("CancelEditComment", "Comments"))
	{
		<input type="hidden" name="entryId" value="@this.Model.EntryId" />
		<button class="linkButton cancelEditComment" title="@Resources.CancelEditComment">@Resources.Cancel</button>
	}
}

</div>
<div class="clear">
</div>